package com.cskaoyan.order.api;

import com.cskaoyan.mall.commons.result.ServiceCallResponse;
import com.cskaoyan.mall.commons.result.ServiceCallResponseUtil;
import com.cskaoyan.mall.order.dto.CreateSeckillOrderRequest;
import com.cskaoyan.order.service.OrderPromoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PromoApiImpl {

    @Autowired
    OrderPromoService orderPromoService;


    @PostMapping(value = "/rpc/promotion/order")
    ServiceCallResponse createPromoOrder(@RequestBody CreateSeckillOrderRequest request) {
        orderPromoService.createPromoOrder(request);

        return new ServiceCallResponseUtil<>().ok(null);
    }
}
